<?php /* Smarty version 2.6.26, created on 2013-06-11 18:50:24
         compiled from ddnpwarea_form_pat2.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'ddnpwarea_form_pat2.html', 372, false),array('function', 'html_options', 'ddnpwarea_form_pat2.html', 383, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/jquery.tablednd_0_5.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.btn_regist').click(function(){
				if ( chktitle() ) {
					if( confirm('登録してよろしいですか？') ){
						document.fm.mode.value = 'input';
						document.fm.submit();
					}
				}
			});
			$('.btn_update').click(function(){
				if ( chktitle() ) {
					if( confirm('更新してよろしいですか？') ){
						document.fm.mode.value = 'input';
						document.fm.submit();
					}
				}
			});
			$('.btn_del').click(function(){
				if( confirm('セールタイトルを削除してもよろしいですか？') ){
					document.fm.mode.value = 'del';
					document.fm.submit();
				}
			});
			$('.btn_return').click(function(){
				location.href = "ddnpwarea_form_pat1.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
";
			});

			$('button.tddel').live('click',function(){
				$(this).closest('tr').remove();
				add_to_sum();
			});
		
			$('#title_cd').change(function(){
				var val = this.value;
				var valObj  = title_disp[val];
				var cdsul   = document.getElementsByName( 'shop_cd[]' );
				var shops   = "";
			
				
				if (valObj) {
					$.each(cdsul, function(i,val){
						shops =  shops + ","  + val.value  ;
						var mapid = "#mp_"  +   val.value ;
						$(mapid).val( ""); 
					}); 
					setmaps(shops ,valObj.sort );
					$("#isirgyu").val( valObj.irgyunm ); 
					var w  = document.fm.w.value ;
					var pa = document.fm.pattern_cd.value ;

					var myDate = new Date();
					var nowtime =  myDate.getTime();
				}else {
					$.each(cdsul, function(i,val){
						var mapid = "#mp_"  +   val.value ;
						$(mapid).val( ""); 
						$("#isirgyu").val( "*"); 
					}); 
				}
				
				if (title_disp[val]){
					$(".tsize").each(function() {
					   $(this).html(valObj.size);
					});
					$(".ttitle").each(function() {
					   $(this).html(valObj.title);
					});
					 gTitleName = valObj.title;
				     gTitleSize = valObj.size;
				     gTitleSort = valObj.sort;
				}else {
					$(".tsize").each(function() {
					   $(this).html("");
					});
					$(".ttitle").each(function() {
					   $(this).html("");
					});
					gTitleName = "";
					gTitleSize = "";
					gTitleSort = "";
				}
			});
			
			add_to_sum();
		});
		function seachObj(vzone, varea, vid, vname, vsale,  vnums, vcount) {
		    this.vzone  = vzone;
		    this.varea  = varea;
		    this.vid    = vid;
		    this.vname  = vname;
		    this.vsale  = vsale;
		    this.vnums  = vnums;
		    this.vcount = vcount;
		}
		function addShopTd(shopcd){
			//alert(existshop(shopcd));
			var obj = searchData[shopcd];
			if (existshop(shopcd)){
				alert("店舗{"+obj.vname+"}はすでに選択されます");
				return ;
			}else{
				
				add_one(obj.vzone, obj.varea, obj.vid, obj.vname, obj.vsale,  obj.vnums, obj.vcount);
				add_to_sum();
			}
		}
		
		function addAllShopTd( ){

			for (var shopid in searchData){
				var obj = searchData[shopid];

				if (existshop(shopid)){
					alert("店舗{"+obj.vname+"}はすでに選択されます");
					return false;
				}
			}

			var html = $("#table_shop tr:last").html();
			html = "<tr>" + html + "</tr>";
			
			$("#table_shop tr:last").remove();
			var shops = "" ;
			for (var shopid in searchData){
				var obj = searchData[shopid];
				add_tr(obj.vzone, obj.varea, obj.vid, obj.vname, obj.vsale,  obj.vnums, obj.vcount);
				shops = shops +  "," + obj.vid;
			}
			$("#table_shop").append(html);
			$('#dialogmutidnpw').innerHTML ="";
			$('#dialogmutidnpw').dialog("close");

			setmaps(shops , gTitleSort )
			add_to_sum();
		}
		function delShopTd(shopcd){
			$('#dialogmutidnpw').innerHTML ="";
			$('#dialogmutidnpw').dialog("close");
			$('#bt' + shopcd).closest('tr').remove();
			add_to_sum();
		}
		function delAllShopTd(){
			
			$('#dialogmutidnpw').innerHTML ="";
			$('#dialogmutidnpw').dialog("close");
			for (var shopid in searchData){
				objid ='#bt' + shopid;
				if ($(objid)) {
					$(objid).closest('tr').remove();
				}
			}
			add_to_sum();
		}
		
	    function rObj(a1, a2,a3,a4) {
	        this.size  = a1;
	        this.title = a2;
	        this.sort  = a3;
	        this.irgyunm  = a4;
	    }
	    
	    var gTitleName = "<?php echo $this->_tpl_vars['forms']['title_name']; ?>
";
	    var gTitleSize = "<?php echo $this->_tpl_vars['forms']['title_size']; ?>
";
	    var gTitleSort = "<?php echo $this->_tpl_vars['forms']['title_sort']; ?>
";
	    var gTitleIrgyunm  = "<?php echo $this->_tpl_vars['forms']['isirgyu']; ?>
";
		var title_disp = new Array();
		<?php $_from = $this->_tpl_vars['titledata']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['kk'] => $this->_tpl_vars['vv']):
        $this->_foreach['member']['iteration']++;
?>
			title_disp["<?php echo $this->_tpl_vars['kk']; ?>
"] = new rObj("<?php echo $this->_tpl_vars['vv']['size']; ?>
", "<?php echo $this->_tpl_vars['vv']['titlecell']; ?>
","<?php echo $this->_tpl_vars['vv']['map']; ?>
","<?php echo $this->_tpl_vars['vv']['irgyunm']; ?>
" );
		<?php endforeach; endif; unset($_from); ?>
		
		function add_to_sum(){
			//パセント計算
			//部数計算
			var nsum = 0;
			$('.nnum').each(function(){
				nsum = nsum +  $(this).val() * 1;
			});
			var nins = 0;
			$('.nins').each(function(){
				nins = nins +  $(this).val() * 1;
			});
			$('#n_count').val( nsum );
			$('#ins_count').val(  nins+'件' );
			
			$('#area_nums').val( nsum );

		}
		function setS( valnm ) {
			eval("document.fm." +  gPara + "_name.value ='" + valnm + "'");	
			$('#dialog').innerHTML ="";
			$('#dialog').dialog("close");
		}
		var g_shop_ul_to_grid = true ;
		function add_tr( vzone, varea, vid, vname, vsale,  vnums, vcount) {
			var table = $('#table_shop');
			var str = '<tr><td> ' + vzone + '</td><td>' + varea + ' </td>';
			str = str + '<td> <input  id="mp_' +  vid + '" type="text" name="map_no[]"  class="dtext"  readonly style="width:85%"> </td>';
			str = str + '<td> ' + vid + '</td><td>' + vname + ' </td>';
			str = str + '<td> <span class= "ttitle">' + gTitleName + '</span>  </td><td><span class="tsize">' + gTitleSize + ' </span> </td>';
			str = str + '<td align=right>' + vsale + ' </td>';
			str = str + '<td align=right>  ' + vnums ;
			str = str + "<input type='hidden'  class='nnum'  id='n_"+ vid +"'  value='" + vnums  + "' name ='shop_nums[]'>";
			str = str + "<input type='hidden' value='" + vid  + "' name ='shop_cd[]'>";
			str = str + "<input type='hidden' value='" + vname + "' name ='shop_name[]'>";
			str = str + "<input type='hidden' value='" + vsale + "' name ='year_sale[]'>";
			str = str + "<input type='hidden'   class='nins'  value='" + vcount  + "' name ='ins_nums[]'>";
			str = str + "<input type='hidden' value='" + vzone + "' name ='zone[]'>";
			str = str + "<input type='hidden' value='" + varea + "' name ='area[]'></td>";
			str = str + '<td align=right><a href="javascript:void(0)" onclick="movetos(\'' +vid  +'\')" >' + vcount + '件 </a> </td>';
			str = str + '<td align="center"><button  id="bt'+vid +'"  type="button" class="tddel">削除</button> </td></tr>';
			$(table).append(str);

		}
		
		function movetos(inid){
			if ( chktitle() ) { 
			var strUrl = "ddnpwarea_form_pat3.php?w=<?php echo $this->_tpl_vars['forms']['w']; ?>
&id=" + inid;
			strUrl = strUrl + "&pcd=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
" ;
			strUrl = strUrl + "&pnm=<?php echo $this->_tpl_vars['forms']['pattern_name']; ?>
" ;
			strUrl = strUrl + "&tnm="+ $("#title_cd").find("option:selected").text();
			var left = parseInt((screen.availWidth - 1000)/2);
			
			var top =  parseInt((screen.availHeight - 700)/2);
			var myWindow =window.open (strUrl, 'nisshops', 'menubar=no,location=no, status=no,toolbar=no,scrollbars=auto,resizable=no,left=' + left + 'px,top='+ top +'px,height=700px, width=1000px');
			myWindow.focus();
			}
		}
		
		function add_one( vzone, varea, vid, vname, vsale, vnums, vcount) {
			var html = $("#table_shop tr:last").html();
			html = "<tr>" + html + "</tr>";
			$("#table_shop tr:last").remove();
			add_tr( vzone, varea, vid, vname, vsale, vnums, vcount);
			$("#table_shop").append(html);
			$('#dialogmutiins').innerHTML ="";
			$('#dialogmutidnpw').dialog("close");
			var shops = "," + vid;
			setmaps(shops , gTitleSort )
		}
		function setmaps(shops ,so ){
			//shops = ,001,002,003
			var w = document.fm.w.value ;
			var pa = document.fm.pattern_cd.value ;
			var myDate = new Date();
			var nowtime =  myDate.getTime();
			//location.href = "ajax_dnpw_get_maps.php?w=" + w + "&s=" + shops +"&pa= " + pa +"&so= " + so;
			$.get("ajax_dnpw_get_maps.php",{ w : w ,s : shops,so:so ,pa:pa , t : nowtime }, function(data){
				//alert(data);
				//var str   =  "002,888*" ;
				var smaps = data.split("*");
				for(i=0;i<smaps.length -1;i++){
					//var strnowmaps =  maps[i];
					var eachsmaps =  smaps[i].split(",");
					var mapid = "#mp_"  +  eachsmaps[0] ;
					$(mapid).val( eachsmaps[1] );
				} 
			});
		}
	
		function existshop(shopcd){
			var shops   = document.getElementsByName( 'shop_cd[]');
			var retflg = false;
			$.each(shops, function(i,val){
				if   (shopcd == val.value) {
					retflg =  true;
				}
			});
			return retflg;
		}
		var add_del_shop_flg = "追加";
		function addshop(){
			var theValue = "";
			//alert("1")
			gMutiObj = "shop";
			add_del_shop_flg = "追加";
			var urlPara = makeURL( gMutiObj, theValue, "mserach_muti_dnpwp_shop.php");
			urlPara = urlPara + "&w=" + '<?php echo $this->_tpl_vars['forms']['w']; ?>
' + "&p=" + '<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
' ;
			//location.href = urlPara;
			 
			$("#dialogmutidnpw").load( urlPara ).dialog({
				modal:true
			}); 
			$('#dialogmutidnpw').dialog('open');
			
		}
		function delshop(){
			var theValue = "";
			gMutiObj = "shop";
			add_del_shop_flg = "削除";
			var urlPara = makeURL( gMutiObj, theValue, "mserach_muti_dnpwp_shop.php");
			urlPara = urlPara + "&del=1&w=" + '<?php echo $this->_tpl_vars['forms']['w']; ?>
' + "&p=" + '<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
' ;
			
			$("#dialogmutidnpw").load( urlPara ).dialog({
				modal:true
			}); 
			$('#dialogmutidnpw').dialog('open');
		}
		function chktitle() {
			var titleid = $("#title_cd").val() ;
			if (titleid.length == 0){
				alert("タイトルを選択してください");
				return false;
			 }
			return true;
		}
		</script>
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>地域広告エリアマスター管理</h2>
			<ul class="submenu clearfix">
				<li>地域広告情報一覧．更新</li>
				 <li><a href = "ddnpwarea_update.php" >地域広告情報登録</a> </li>
				 <li><a href = "ddnparea_index.php" >DNPエリアマスタ</a></li>
			</ul>
			<h3>地域広告情報<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?><?php if ($this->_tpl_vars['phase'] == 'complete'): ?>完了<?php endif; ?></h3>
<?php if ($this->_tpl_vars['phase'] == 'input'): ?>
			<p class="message">内容を確認し、<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?>ボタンをクリックしてください。</p>
			<form name="fm" action="ddnpwarea_form_pat2.php" method="post">
				<table class="formTable">
					<tbody>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
						<tr>
							<th>更新日</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['u_time']; ?>
<input type="hidden" name="u_time" value="<?php echo $this->_tpl_vars['forms']['u_time']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>更新者</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
<input type="hidden" name="m_user_name" value="<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>ID</th>
							<td><?php echo $this->_tpl_vars['forms']['id']; ?>
</td>
						</tr>
<?php endif; ?>
						<tr><th>※週名/折込日</th>
							<td>
								<input type="text" name="dispw" class="dtext" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['dispw'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" readonly="readonly" />
								<input type="hidden" name="w"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['w'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" /><?php echo $this->_tpl_vars['err']['weekmsg']; ?>

							</td>
						</tr>
						<tr><th>パターンコード</th>
						<td><?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
<input type="hidden" name="pattern_cd" value="<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
" /></td>
						</tr><tr><th>新聞紙名</th>
						<td><?php echo $this->_tpl_vars['forms']['pattern_name']; ?>
<input type="hidden" name="pattern_name" value="<?php echo $this->_tpl_vars['forms']['pattern_name']; ?>
" /></td>
						</tr><tr>
							<th>セールタイトル</th>
							<td>
								<?php echo smarty_function_html_options(array('id' => 'title_cd','name' => 'title_cd','options' => $this->_tpl_vars['titles'],'selected' => $this->_tpl_vars['forms']['title_cd']), $this);?>
<?php echo $this->_tpl_vars['err']['title_cd']; ?>

							</td>
						</tr><tr>
							<th>MAP</th>
							<td>
								<input type="text" name="isirgyu" id="isirgyu" class="dtext" value="<?php echo $this->_tpl_vars['forms']['isirgyu']; ?>
"  readonly/><?php echo $this->_tpl_vars['err']['grid']; ?>

							</td>
						</tr><tr>
							<th>セールタイトル部数</th>
							<td>
								<input type="text" name="area_nums" id="area_nums" class="dtext" value="<?php echo $this->_tpl_vars['forms']['area_nums']; ?>
"  readonly/>
							</td>
						</tr>

					</tbody>
				</table>
<p class="button">実施版一覧</p>
			<table id="table_shop" class="formTable" >
					<thead>
						<tr>
							<th style="width:80px">ゾーンAJA</th><th style="width:80px">エリアAJA</th><th>マップNo</th>
							<th style="width:80px">店舗</br>コード</th>
							<th style="width:200px">店舗名</th>
							<th style="width:200px">セルタイトル名</th>
							<th>サイズ</th><th>年商</th><th>店舗部数</th><th style="width:200px">販売店</th>
							<th style="width:50px" >操作</th>
						</tr>
					</thead>
					<tbody>
<?php $_from = $this->_tpl_vars['forms']['mutirow']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
	<tr>
		<td> <?php echo $this->_tpl_vars['v']['zone']; ?>
 </td>
		<td> <?php echo $this->_tpl_vars['v']['area']; ?>
 </td>
		<td> <input  id="mp_<?php echo $this->_tpl_vars['v']['shop_cd']; ?>
" type="text" name="map_no[]" value="<?php echo $this->_tpl_vars['v']['map_no']; ?>
" class="dtext"  readonly style="width:85%"></td>
		<td> <?php echo $this->_tpl_vars['v']['shop_cd']; ?>
 </td>
		<td> <?php echo $this->_tpl_vars['v']['shop_name']; ?>
 </td>
		<td> <span class = "ttitle"><?php echo $this->_tpl_vars['forms']['title_name']; ?>
</span> </td>
		<td> <span class = "tsize"><?php echo $this->_tpl_vars['forms']['title_size']; ?>
</span> </td>
		<td align=right> <?php echo $this->_tpl_vars['v']['year_sale']; ?>
 </td>
		<td align=right> <?php echo $this->_tpl_vars['v']['shop_nums']; ?>

		<input type="hidden" value="<?php echo $this->_tpl_vars['v']['shop_nums']; ?>
" id="n_<?php echo $this->_tpl_vars['v']['shop_cd']; ?>
" class='nnum'  name="shop_nums[]">
		<input type="hidden" name="shop_cd[]"  value="<?php echo $this->_tpl_vars['v']['shop_cd']; ?>
">
		<input type="hidden" name="shop_name[]"   value="<?php echo $this->_tpl_vars['v']['shop_name']; ?>
">
		<input type="hidden" name="year_sale[]"   value="<?php echo $this->_tpl_vars['v']['year_sale']; ?>
">
		<input type="hidden" name="ins_nums[]"   class='nins'  value="<?php echo $this->_tpl_vars['v']['ins_nums']; ?>
">
		<input type="hidden" name="zone[]"   value="<?php echo $this->_tpl_vars['v']['zone']; ?>
">
		<input type="hidden" name="area[]"  value="<?php echo $this->_tpl_vars['v']['area']; ?>
">
		</td><td align=right> <a href="javascript:void(0)" onclick="movetos('<?php echo $this->_tpl_vars['v']['shop_cd']; ?>
')" ><?php echo $this->_tpl_vars['v']['ins_nums']; ?>
 件 </a></td>
		<td align="center"><button type="button" id ="bt<?php echo $this->_tpl_vars['v']['shop_cd']; ?>
" class="tddel">削除</button></td>
		</tr>
<?php endforeach; endif; unset($_from); ?>
		<tr><td colspan='2'  align="center"> 合計 </td>
		<td> &nbsp; </td><td> &nbsp; </td><td> &nbsp; </td><td> &nbsp; </td><td> &nbsp; </td><td> &nbsp; </td>
		<td align=right><input class="dtext" type="text"  style="text-align:right"  id="n_count" readonly="readonly" name="n_count" value = "<?php echo $this->_tpl_vars['forms']['n_count']; ?>
"></td>
		<td align=right><input class="dtext" type="text"  style="text-align:right" id="ins_count" readonly="readonly" name="ins_count" value = "<?php echo $this->_tpl_vars['forms']['ins_count']; ?>
件" ></td> <td> &nbsp; </td>
		</tr></tbody>
		</table>
<p><a href="javascript:void(0)" onclick="addshop()">[店舗を追加する]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:void(0)" onclick="delshop()">[店舗を削除する]</a></p>
				<p class="button">
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<button type="button" class="btn_del" class="submit"><span>セールタイトル削除</span></button> 
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php endif; ?>				
				
				<button type="button" class="btn_return" class="submit"><span>戻る</span></button>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<button type="button" class="btn_update" class="submit"><span>更新</span></button>
<?php else: ?>
				<button type="button" class="btn_regist" class="submit"><span>登録</span></button>
<?php endif; ?>
				</p>
				<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['forms']['id']; ?>
" />
				<input type="hidden" name="isshop" value="<?php echo $this->_tpl_vars['isshop']; ?>
" />
				<input type="hidden" name="mode" value="" />
			</form>

<div id="dialog" >
</div>
 <div id="dialogmutidnpw"  class = "dialogdnpw">
</div>


<?php endif; ?>

<?php if ($this->_tpl_vars['phase'] == 'complete'): ?>
			<p class="message"><?php echo $this->_tpl_vars['message']; ?>
</p>
			<ul>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="ddnpwarea_form_pat1.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">一覧ページに戻る</a></li>
<?php else: ?>
				<li>>> <a href="ddnpwarea_form_pat1.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">一覧ページに戻る</a></li>
<?php endif; ?>
				<li>>> <a href="ddnpwarea_form_pat2.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">新規登録</a></li>
				
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="ddnpwarea_form_pat2.php?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
&p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">更新</a></li>
<?php endif; ?>
			</ul>
<?php endif; ?>
<?php if ($this->_tpl_vars['phase'] == 'deleted'): ?>
	<p class="message"><?php echo $this->_tpl_vars['message']; ?>
</p>
	<ul>
		<li>>> <a href="ddnpwarea_form_pat1.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">一覧ページに戻る</a></li>
		<li>>> <a href="ddnpwarea_form_pat2.php?p=<?php echo $this->_tpl_vars['forms']['pattern_cd']; ?>
&w=<?php echo $this->_tpl_vars['forms']['w']; ?>
">新規登録</a></li>
	</ul>
<?php endif; ?>
		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>